package com.micro.train.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.sql.Time;
import java.time.LocalDateTime;

/**
 * 火车信息实体类
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("列车信息")
public class Train {
    
    @TableId(value = "列车ID", type = IdType.AUTO)
    private Long trainId;
    
    @TableField("车次")
    private String trainNumber;
    
    @TableField("列车类型")
    private String trainType; // G-高铁,D-动车,K-快速,T-特快,Z-直达等
    
    @TableField("始发站ID")
    private Long departureStationId;
    
    @TableField("终点站ID")
    private Long terminalStationId;
    
    @TableField("始发时间")
    private Time departureTime;
    
    @TableField("终到时间")
    private Time arrivalTime;
    
    @TableField("运行时长")
    private Integer duration; // 运行总时长(分钟)
    
    @TableField("状态")
    private Integer status = 1; // 0-停运,1-运行中,2-临时停运
    
    @TableField("车厢数量")
    private Integer carriageCount;
    
    @TableField(value = "创建时间", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    @TableField(value = "更新时间", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    @TableLogic
    @TableField("deleted")
    private Integer deleted;
}
